package com.zhouxiaoge.seleniumjava;

import org.openqa.selenium.By;
import org.openqa.selenium.edge.EdgeDriver;
import org.openqa.selenium.edge.EdgeOptions;

public class BaiduSearch {


    public static void main(String[] args) {
        // 先启动浏览器debug模式
        System.setProperty("webdriver.chrome.driver", "C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe");
        EdgeOptions edgeOptions = new EdgeOptions();
        edgeOptions.setExperimentalOption("debuggerAddress", "127.0.0.1:9222");
        EdgeDriver edgeDriver = new EdgeDriver(edgeOptions);
        edgeDriver.get("https://cn.bing.com/");
//        edgeDriver.findElement(By.id("#id_a")).click();
        edgeDriver.findElement(By.cssSelector("input[aria-owns$='as']")).sendKeys("123");
        edgeDriver.findElement(By.cssSelector("svg[viewBox$='25']")).click();
        System.out.println(edgeDriver.getTitle());
        edgeDriver.get("https://cn.bing.com/");
        edgeDriver.quit();

    }
}
